package com.third.customer.model.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.third.customer.model.dao.param.CustomerParam;
import com.third.customer.model.tables.Customer;

import java.util.List;
import java.util.Optional;

/**
 * Created by hehuaichun on 2020/5/21.
 */
public interface CustomerDao {

    Page<Customer> query(CustomerParam param);

    Optional<Customer> getById(long companyId, Long customerId);

    List<Customer> getByAreaId(long companyId, long areaId);

    List<Customer> getByGroupId(long companyId, long groupId);

    Optional<Customer> getByPhone(Long companyId, String phone);

    List<Customer> getByCompanyId(Long companyId);

    boolean insert(Customer customer);

    boolean update(Customer customer);

    boolean delete(Long id);
}
